<%#
    Auth: Wen
    Version: V1.0
    Data: 2019.8.20
    Function:
%>
<%+header%>
<html>
    <head>
    <meta charset="utf-8">
    <title>Wen</title>
    <script type="text/javascript">
    /* 定时刷新返回结果 */
    function GetAntennaStatus()
    {
        //每3s，获取天线状态信息的结果
        XHR.poll(3, "<%=controller%>admin/ACU_Antenna/getAntennaStatus", {token:'<%=token%>', step: '1'}, function(x)
        {
            //对返回的数据进行解析，并填入到相应的控件
            var str = x.responseText;
            //是否有错误警告
            if(str.match(/Error/g) == null)
            {
                var n = str.split(",");
                switch(n[2])
                {
                    case '0':
                        document.getElementById("antennaStatus").innerHTML = "<%:Initializing%>";
                        break;
                    case '1':
                        document.getElementById("antennaStatus").innerHTML = "<%:Searching Sat%>";
                        break;
                    case '2':
                        document.getElementById("antennaStatus").innerHTML = "<%:Manual Control%>";
                        break;
                    case '3':
                        document.getElementById("antennaStatus").innerHTML = "<%:Lock%>";
                        break;
                    case '4':
                        document.getElementById("antennaStatus").innerHTML = "<%:Researching Sat%>";
                        break;
                    case '5':
                        document.getElementById("antennaStatus").innerHTML = "<%:Ins Hold%>";
                        break;
                    case '6':
                        document.getElementById("antennaStatus").innerHTML = "<%:Malfunction%>";
                        break;
                    case '7':
                        document.getElementById("antennaStatus").innerHTML = "<%:Testing%>";
                        break;
                    default:
                        break;
                }
                document.getElementById("currentAzimuthAngle").innerHTML = n[3] + "&#176";
                document.getElementById("currentPitchAngle").innerHTML = n[4] + "&#176";
                document.getElementById("currentPolAngle").innerHTML = n[5] + "&#176";
                document.getElementById("currentRollAngle").innerHTML = n[6] + "&#176";
                document.getElementById("presetAzimuthAngle").innerHTML = n[7] + "&#176";
                document.getElementById("presetPitchAngle").innerHTML = n[8] + "&#176";
                document.getElementById("presetPolAngle").innerHTML = n[9] + "&#176";                
                document.getElementById("presetRollAngle").innerHTML = n[10] + "&#176";
                document.getElementById("agcVoltage").innerHTML = n[11] + "V";
                document.getElementById("trackingFrequency").innerHTML = n[12] + "MHz";
                document.getElementById("antennaPitchDrift").innerHTML = n[13] + "&#176";
                if(n[16] == '99.9')
                {
                    document.getElementById("trackingSatelliteLongitude").innerHTML  = "HTS-A";
                }
                else
                {
                    document.getElementById("trackingSatelliteLongitude").innerHTML = n[16] + "&#176";
                }
                var y = n[17].split("*");
                if(y[0] == '0')
                {
                    document.getElementById("polMode").innerHTML = "<%:V%>";
                }
                else
                {
                    document.getElementById("polMode").innerHTML = "<%:H%>";
                }
                document.getElementById("warmingGetSub").innerHTML = "";
            }
            else
            {
                document.getElementById("warmingGetSub").innerHTML = "Title:" + x.responseText;
            }
        });
    }

    </script>
    </head>
    <body>
        <p style="color:red;" id="warmingGetSub"></p>
        <fieldset class="cbi-section">
        <div class="widget-box">
            <div class="widget-title">
                <span class="icon">
                <i class="icon-align-justify"></i>
                </span>
                <h5><%:Antenna Status Info%></h5>
            </div>
            <div class="widget-content nopadding">
                <table width="100%" cellspacing="10">
                    <tr><td width="33%"><%:Antenna Status%></td><td id="antennaStatus"></td></tr>
                    <tr><td width="33%"><%:Current Azimuth Angle%></td><td id="currentAzimuthAngle"></td></tr>
                    <tr><td width="33%"><%:Current Pitch Angle%></td><td id="currentPitchAngle"></td></tr>
                    <tr><td width="33%"><%:Current Pol Angle%></td><td id="currentPolAngle"></td></tr>
                    <tr><td width="33%"><%:Current Roll Angle%></td><td id="currentRollAngle"></td></tr>
                    <tr><td width="33%"><%:Preset Azimuth Angle%></td><td id="presetAzimuthAngle"></td></tr>
                    <tr><td width="33%"><%:Preset Pitch Angle%></td><td id="presetPitchAngle"></td></tr>
                    <tr><td width="33%"><%:Preset Pol Angle%></td><td id="presetPolAngle"></td></tr>
                    <tr><td width="33%"><%:Preset Roll Angle%></td><td id="presetRollAngle"></td></tr>
                    <tr><td width="33%"><%:AGC Voltage%></td><td id="agcVoltage"></td></tr>
                    <tr><td width="33%"><%:Tracking Frequency%></td><td id="trackingFrequency"></td></tr>
                    <tr><td width="33%"><%:Antenna Pitch Drift%></td><td id="antennaPitchDrift"></td></tr>
                    <tr><td width="33%"><%:Tracking Satellite Longitude%></td><td id="trackingSatelliteLongitude"></td></tr>
                    <tr><td width="33%"><%:Pol Mode%></td><td id="polMode"></td></tr>
                </table>
            </div>
        </div>
        <script>
        GetAntennaStatus();
        </script>
        </fieldset>
    </body>
</html>
<%+footer%>